<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10 row">
    <!--<div class="col-md-3">-->
        <!--<select class="form-control" ng-model="vm.country" ng-options="country.label for country in vm.countries">-->
            <!--<option value="">&#45;&#45; 请选择国家 &#45;&#45;</option>-->
        <!--</select>-->
    <!--</div>-->
    <div class="col-md-3" >
        <select class="form-control" ng-model="curWidget.config.province.code" ng-change="setCities()"
                ng-options="province.code as province.name for province in provinces">
            <option value="">选择省份/州</option>
        </select>
    </div>
    <div class="col-md-3" ng-if="cities.length>0">
        <select class="form-control" ng-model="curWidget.config.city.code" ng-init="setCities()"
                ng-options="city.code as city.name for city in cities">
            <option value="">选择城市/县区</option>
        </select>
    </div>
</div>
</div>
<div ng-include="'org/cboard/view/config/chart/template/config.html'"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">{{'CONFIG.WIDGET.VALUE'|translate}}</label>
    <div class="col-sm-10">
        <div dnd-list="curWidget.config.values[0].cols"
             dnd-inserted="dndTransfer.toCol(curWidget.config.values[0].cols,index,item,type)"
             dnd-allowed-types="['measure','select','col','exp']"
             dnd-drop="curWidget.config.values[0].cols.length<1 ? item:false"
             ng-class="{highlight: targetHighlight.value}"
             class="form-control" style="min-height: 35px;height: auto;padding: 0px">
            <div class="dndPlaceholder sort-highlight"
                 style="height: 24px; width: 93px;margin: 3px 3px;display: inline-block;vertical-align: middle;">
            </div>
            <div ng-repeat="o in curWidget.config.values[0].cols" dnd-draggable="o" dnd-type="o.type=='exp'?'exp':'col'"
                 dnd-effect-allowed="move"
                 dnd-moved="curWidget.config.values[0].cols.splice($index, 1)" class="btn-group"
                 style="margin: 3px 3px;">
                <ng-switch on="o.type">
                    <div ng-switch-when="exp" class="btn-group">
                        <button type="button" class="btn btn-primary btn-sm" style="cursor: move;" ng-click="curWidget.config.values[0].cols.splice($index, 1);">
                            {{o.alias}}
                        </button>
                        <button type="button" class="btn btn-primary btn-sm dropdown-toggle"
                                ng-click="editSort(o);cleanRowSort(o);">
                            <span class="fa" ng-class="{undefined:'fa-sort','asc':'fa-sort-asc','desc':'fa-sort-desc'}[o.sort]"></span>
                        </button>
                        <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                            <span class="fa fa-edit"></span>
                        </button>
                        <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
                            <li ng-if="!isDsExpression(o)">
                                <a ng-click="editExp(o)">{{'COMMON.EDIT'|translate}}</a>
                            </li>
                            <li>
                                <a ng-click="editVFilter(o)">{{'CONFIG.WIDGET.FILTER'|translate}}</a>
                            </li>
                        </ul>
                    </div>
                    <div ng-switch-default class="btn-group">
                        <button type="button"
                                ng-click="curWidget.config.values[0].cols.splice($index, 1);"
                                class="btn btn-default btn-sm" style="cursor: move;">
                            {{o.aggregate_type+'('+o.col+')'+ (o.alias?(' -> '+o.alias):'')}}
                        </button>
                        <button type="button" class="btn btn-default btn-sm dropdown-toggle"
                                ng-click="editSort(o);cleanRowSort(o);">
                            <span class="fa" ng-class="{undefined:'fa-sort','asc':'fa-sort-asc','desc':'fa-sort-desc'}[o.sort]"></span>
                        </button>
                        <button type="button" class="btn btn-default btn-sm dropdown-toggle"
                                data-toggle="dropdown">
                            <span class="fa fa-edit"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                            <li><input class="form-control" ng-model="o.alias" placeholder="{{'CONFIG.WIDGET.ALIAS'|translate}}"></li>
                            <li ng-repeat="a in value_aggregate_types">
                                <a ng-click="o.aggregate_type=a.value">{{a.name+'('+o.col+')'}}</a>
                            </li>
                            <li>
                                <a ng-click="editVFilter(o)">{{'CONFIG.WIDGET.FILTER'|translate}}</a>
                            </li>
                        </ul>
                    </div>
                </ng-switch>
            </div>
        </div>
    </div>
</div>